Barcodes are universally used in many applications, such as a machine-readable symbols containing desired information. For example, a barcode can be used on a package to provide all kinds of information from the manufacturer regarding the product, or can be used as a digital movie ticket displayed on a mobile phone LCD screen. To contain more information in a small area such as a mobile phone display, a two-dimensional barcode, such as a Data Matrix barcode, is advantageous. Information encoded in a barcode is usually represented by black and white data modules such as bars, squares, etc, and arranged with finders of a specific pattern. The finders need to be located when the barcode is decoded.
FIGS. 1 and 2 illustrate a Data Matrix barcode displayed on a mobile phone LCD screen and its characterized images. As is well-known in the art, a Data Matrix barcode (see FIG. 3) is a two-dimensional matrix symbology containing dark and light square data modules. It has a finder pattern of two intersecting solid edges 1, 2 and two intersecting alternating dark and light edges 3, 4 on the perimeter of the symbol. To decode a barcode displayed on as an image on an LCD screen (FIG. 1a), a binarized image (FIG. 1b) is generated from the original gray image (FIG. 1a) by means of algorithms, which can be eventually be packaged in FPGA or ASIC. The term binarize refers herein to the process by which a symbol is read and then portions of it are classified into one of two types, usually but not necessarily dark or light.
As shown in FIGS. 1a and 1b, when the gray image has a high contrast compared to its background, the image is clear enough that the barcode may easily be binarized. However, when the contrast is low, such as shown in FIG. 2a when the backlight of the LCD screen is turned off, the image may be so unclear (as shown in FIG. 2b) that it is difficult or impossible to correctly decode the symbol if one tries to simply binarize it as in FIG. 1.
Another problem of prior systems is that when scanning an image to be decoded, there is usually a fixed threshold above which an area is deemed “light”, and below which an area is deemed “dark”. In other words, the decision as to whether the part of the symbol being scanned is dark or light is a simple matter of comparing reflected light level with a fixed threshold. When contrast is low however, the appropriate threshold may be only applicable locally, to a particular area of the symbol being read. Hence, the use of a particular optimized fixed threshold in one area of the symbols being scanned does not necessarily mean that the same fixed threshold for distinguishing dark from light will be applicable in another area.
An object of the present invention is therefore to provide a method for finding a barcode or symbol in a dark background in the gray image, e.g., displayed on a dark LCD screen without binarizing the whole image first.